package practice.factory;



public class OperatinFactory {
    public static Operation1 createOperate(String operate) {

        Operation1 oper = null;
        switch (operate) {
            case "+":
                oper = new OperationAdd();
                break;
            case "-":
                oper = new OperationSub();
                break;
            case "*":
                oper = new OperationMul();
                break;
            case "/":
                oper =new OperationDiv();
                break;
        }
        return oper;
    }
}
